<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('员工详细信息')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="user-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                姓名：<input type="text" name="name"/>
                            </li>
                            <li>
                                工号：<input type="text" name="badge"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-primary single" onclick="$.operate.edit()">
                    <i class="fa fa-edit"></i> 修改
                </a>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>

<script th:inline="javascript">
    var prefix = ctx + "bgInfo/detailedEmpInfo";
    $(function () {
        var panehHidden = false;
        if ($(this).width() < 800) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 350});
        queryData();
    });

    function queryData() {
        var columns = [];
        var checkbox = {checkbox: true};
        var badge = {field: 'badge', title: '工号'};
        var name = {field: 'name', title: '姓名'};
        var compName = {field: 'compName', title: '公司名称'};
        var depName = {field: 'depName', title: '部门名称'};
        var jobName = {field: 'jobName', title: '工作岗位'};
        var ReportToTitle = {field: 'ReportToTitle', title: '直接上级'};
        var WFReportToTitle = {field: 'WFReportToTitle', title: '职能上级'};
        var empStatusName = {field: 'empStatusName', title: '员工状态'};
        var jobStatusName = {field: 'jobStatusName', title: '在岗状态'};
        var WorkBeginDate = {field: 'WorkBeginDate', title: '参加工作时'};
        var MarriageTitle = {field: 'MarriageTitle', title: '婚姻状况'};
        var NationTitle = {field: 'NationTitle', title: '名族'};
        var Resident = {field: 'Resident', title: '籍贯'};
        var PartyTitle = {field: 'PartyTitle', title: '政治面貌'};
        var CertNo = {field: 'CertNo', title: '身份证号码'};
        var certaddress = {field: 'certaddress', title: '身份证地址'};
        var Address = {field: 'Address', title: '现在住址'};
        var tel = {field: 'tel', title: '联系电话'};
        var zj = {field: 'zj', title: '座机'};
        var dh = {field: 'dh', title: '短号'};
        var eMail = {field: 'eMail', title: '公司邮箱'};
        var Constellation = {field: 'Constellation', title: '星座'};
        var QQ = {field: 'qq', title: 'QQ'};
        var Wechart = {field: 'Wechart', title: '微信'};
        var army = {
            title: '是否参军',
            formatter: function (value, row, index) {
                if(row.army == 0){
                    return '否'
                }else if(row.army == 1){
                    return '是'
                }
            }
        };
        var leavearmy = {field: 'leavearmy', title: '退伍部队'};
        columns.push(checkbox,badge,name,compName,depName,jobName,ReportToTitle,WFReportToTitle);
        columns.push(empStatusName,jobStatusName,WorkBeginDate,MarriageTitle,NationTitle,Resident);
        columns.push(PartyTitle,CertNo,certaddress,Address,tel,zj,dh,eMail,Constellation,QQ);
        columns.push(Wechart,army,leavearmy);

        var options = {
            code: "eid",
            uniqueId: "eid",
            url: prefix + "/findDataList",
            createUrl: prefix + "/addEmp",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            detailUrl: prefix + "/detail/{id}",
            escape: true,
            showPageGo: true,
            rememberSelected: true,
            height: $(window).height() - 120,
            sortOrder: "desc",
            modalName: "合同续签登记",
            columns: columns
        };
        $.table.init(options);
    }


</script>
</body>
</html>